import os
import sys

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

chrome_options = Options()
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])

# 创建Chrome驱动程序
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=chrome_options)
driver.maximize_window()

# 网站列表
path = os.path.dirname(sys.argv[0])
f = os.path.join(path, 'url.txt')

websites = open(f).readlines()

driver.get(websites[0])

while True:
    pass
